# # coding=utf-8
import time
import xlrd
#最大行数65536
from xlutils.copy import copy

# 生成跨境电商个人清单
excel_path = "../..\项目文件\清单表(1)(1)(1).xlsx"
data = xlrd.open_workbook(excel_path)
new_1 = copy(data)

start_time = time.strftime('%Y%m%d%H%M%S')
print("开始时间：" + str(start_time))

# # 查看工作表
# table = ""
data.sheet_names()
print("全部sheet页如下：\n" + str(data.sheet_names()))
for s in data.sheet_names():
    # print(s)
    table = data.sheet_by_name(s)

    print("总行数：" + str(table.nrows))
    print("总列数：" + str(table.ncols))

    wr_sheet = new_1.get_sheet(s)
    i = 0
    j = 4021113014471000120

    m = 10
    for i in range(0, m):
        try:
            wr_sheet.write(i+1, 0, str("%s" % j))  # 所用账号
            print("写入。。。。%s" % j)
        except Exception as E:
            new_1.save(excel_path)
            print("%s写入失败：%S" % str(i), E)
        j += 1
new_1.save(excel_path)  # 更新测试用例文件
data.close()


